<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="arocms.Constans"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="ar"%>


<html:link action="/Gallery/UploadForm" styleClass="button">Upload Form</html:link>
<ar:pager action="/Gallery/List" collection="<%=Constans.IMAGE_LIST_PATH%>" pageSize="5" parameterName="faevc"/>

<logic:present name="<%=Constans.IMAGE_LIST_PATH%>">
    <logic:iterate name="<%=Constans.IMAGE_LIST_PATH%>" id="image">
        <table>
            <tr>
                <td rowspan="2">
                      <!-- <img src="<html:rewrite action="/Gallery/Thumbnail"/>?id=${image.id}&width=200&height=150"/> -->
                      <html:link action="/Gallery/FullImage" paramId="id" paramName="image" paramProperty="id">
                          <ar:thumb action="/Gallery/Thumbnail.do" id="${image.id}" height="150" width="200"/>
                      </html:link>
                </td>
                <td>
                    ${image.title}
                </td>
                <td>
                    <html:link action="/Gallery/Delete" paramId="id" paramName="image" paramProperty="id">Delete</html:link>
                    <html:link action="/Gallery/Edit" paramId="id" paramName="image" paramProperty="id">Edit</html:link>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    ${image.description}
                </td>
            </tr>
            
        </table>
        
        
    </logic:iterate>
</logic:present>